{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import pydicom\n",
    "import os\n",
    "import matplotlib.pyplot as plt\n",
    "import cv2\n",
    "from keras.preprocessing.image import ImageDataGenerator\n",
    "from HDF5DatasetWriter import HDF5DatasetWriter\n",
    "from HDF5DatasetGenerator import HDF5DatasetGenerator\n",
    "from utils import *\n",
    "from tqdm import tqdm\n",
    "import cv2\n",
    "from skimage import io\n",
    "from Unet import *\n",
    "from keras.callbacks import EarlyStopping, ModelCheckpoint, LearningRateScheduler, TensorBoard"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "img = plt.imread('./preds/第二轮/0_pred.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([], dtype=int64), array([], dtype=int64))"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "img = np.array(img)\n",
    "np.where(img)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x209dc946940>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAADXBJREFUeJzt3F2oZeV9x/Hvr/NmEhMnvjLMDB0l\nc5FctE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c\nuz7Jwn9Mw738qs+2/RTg5WVo70LgM0l+AtzG4HDiphnsE5j8VyFMOxgeAba2M79rGZzEOTDlno41\nk7eXZ7BrcCtwuKq+Mqv9Jjmj7SmQ5H3AJ4HDwAPAFe/Q50L/VwD3VzswnqSqur6qNlXVFgZ/D++v\nqs/OWp+wTF+FsJwnn97hJMoOBmfUnwX+asq9fAt4EXiLQcruZnDceBB4pi1PbXMD/H3r+4fAtmXu\n9fcY7A4+ATzWHjtmrV/gd4BHW59PAn/d6ucA32Nwe/6/AOta/aS2Pte2nzOFvwcX8etPJWauz9bT\n4+3x1MK/m3H+7r3yUVJn2ocSkmaQwSCpYzBI6hgMkjoGg6SOwSCpYzBI6hgMkjr/D4penRrjWsu1\nAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.imshow(img)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "tensorflow-gpu",
   "language": "python",
   "name": "tensorflow-gpu"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
